@echo off
echo 测试 Akka Persistence + Outbox 模式
echo =====================================

echo.
echo 1. 创建订单
curl -X POST http://localhost:8080/api/orders ^
  -H "Content-Type: application/json" ^
  -d "{\"orderId\":\"O-20001\",\"customerId\":\"C-9527\",\"items\":[{\"productId\":\"PRODUCT_001\",\"quantity\":2,\"price\":19.9}],\"totalAmount\":39.8}"

echo.
echo 2. 查询订单状态
curl -X GET http://localhost:8080/api/orders/O-20001

echo.
echo 3. 支付订单
curl -X POST http://localhost:8080/api/orders/O-20001/pay ^
  -H "Content-Type: application/json" ^
  -d "{\"paymentId\":\"P-001\",\"paymentMethod\":\"ALIPAY\",\"amount\":39.8}"

echo.
echo 4. 再次查询订单状态
curl -X GET http://localhost:8080/api/orders/O-20001

echo.
echo 5. 查询订单事件历史
curl -X GET http://localhost:8080/api/events/orders/O-20001

echo.
echo 6. 查询库存状态
curl -X GET http://localhost:8081/api/inventory/status

echo.
echo 7. 查询库存事件历史
curl -X GET http://localhost:8081/api/inventory/events/orders/O-20001

echo.
echo 测试完成！
pause

